package org.example.day20241221;

import org.apache.flink.api.common.functions.FlatMapFunction;
import org.apache.flink.api.java.tuple.Tuple;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.LocalStreamEnvironment;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.util.Collector;

import java.util.ArrayList;
import java.util.List;

/**
 * Hello world!
 */
public class App {
    public static void main(String[] args) throws Exception {
        System.out.println("start flink.....");
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        //设置并行度
        env.setParallelism(1);
//        localEnv.fromSource()
        DataStreamSource<Integer> source = env.fromData(1, 2, 3, 4, 5);
//        List<Tuple2<String,Integer>> data = new ArrayList<>();
//        DataStreamSource<Tuple2<String, Integer>> streamSource = localEnv.fromData(data);
//        source.
        source.print();
        env.execute();
        System.out.println("end flink.....");

    }
}
